import { Badge } from 'antd';
import { getReasonType } from '@/utils/Common';

const columns = [
  {
    title: '机构名称',
    key: 'unitName',
    dataIndex: 'unitName',
    fixed: 'left',
    width: 150,
    ellipsis: true
  },
  {
    title: '条形码',
    key: 'barCode',
    dataIndex: 'barCode',
    fixed: 'left',
    width: 100,
    ellipsis: true
  },
  {
    title: '正题名',
    key: 'title',
    dataIndex: 'title',
    width: 150,
    ellipsis: true
  },
  {
    title: 'ISBN',
    key: 'isbn',
    dataIndex: 'isbn',
    width: 150,
    ellipsis: true
  },
  {
    title: '责任者',
    key: 'author',
    dataIndex: 'author',
    width: 150,
    ellipsis: true
  },
  {
    title: '出版社',
    key: 'phName',
    dataIndex: 'phName',
    width: 150,
    ellipsis: true
  },
  {
    title: '分类号',
    key: 'classNo',
    dataIndex: 'classNo',
    width: 100,
    ellipsis: true
  },
  {
    title: '批次',
    key: 'abName',
    dataIndex: 'abName',
    width: 100,
    ellipsis: true
  },
  {
    title: '出版日期',
    key: 'phDate',
    dataIndex: 'phDate',
    width: 100,
    ellipsis: true
  },
  {
    title: '索书号',
    key: 'callNumber',
    dataIndex: 'callNumber',
    width: 100,
    ellipsis: true
  },
  {
    title: '藏馆',
    key: 'libName',
    dataIndex: 'libName',
    width: 100,
    ellipsis: true
  },
  {
    title: '库室',
    key: 'srName',
    dataIndex: 'srName',
    width: 100,
    ellipsis: true
  },
  {
    title: '注销日期',
    key: 'closeTime',
    dataIndex: 'closeTime',
    width: 100,
    ellipsis: true
  },
  {
    title: '注销原因',
    key: 'closeReasonId',
    dataIndex: 'closeReasonId',
    width: 100,
    render: (type) => {
      const info = getReasonType(type);
      return <Badge status={info.badge} text={info.name} />
    }
  },
  {
    title: '操作员',
    key: 'closeOperator',
    dataIndex: 'closeOperator',
    width: 100,
    align: 'center',
    fixed: 'right'
  }
];
export default columns